<template>
	<view class="store">
		<view class="header">
			<navigator delta="1" open-type="navigateBack" class="return">
				<image src="../../static/image/fanhui1@3x.png" mode="widthFix" style="width: 70rpx;"></image>
			</navigator>
		</view>
		<view class="timer-address">
			<text class="title">{{store.shopName}}</text>
			<view class="image">
				<image src="../../static/image/manxing@3x.png" mode="widthFix"></image>
				<image src="../../static/image/manxing@3x.png" mode="widthFix"></image>
				<image src="../../static/image/manxing@3x.png" mode="widthFix"></image>
				<image src="../../static/image/manxing@3x.png" mode="widthFix"></image>
				<text class="score">4.8</text>
				<text class="order">总订单</text>
				<text class="number">369</text>
			</view>
			<view class="working">
				<image src="../../static/image/yingye@3x.png" mode="widthFix"></image>
				<text>营业中 8.30 - 19.00</text>
			</view>
			<view class="address">
				<view class="text">
					<text class="text1">{{store.shopAddress}}</text>
					<text class="text2">距离您 2.3km，驾车 8 分钟</text>
				</view>
				<view class="navButton"
					@click="openMap(store.shopLngLat.lng,store.shopLngLat.lat,store.shopAddress,'bd09')">
					<image src="../../static/image/daohang@3x.png" mode="widthFix"></image>
				</view>
			</view>
		</view>
		<view class="line">
			<image src="https://i.loli.net/2021/04/15/Mx8YJGfj25rAUWl.png" mode="widthFix"></image>
		</view>
		<view class="storeService">
			<text class="storeName">门店服务</text>
			<view class="picture">
				<image src="https://i.loli.net/2021/04/13/cqjt2R4mlYywWEV.png" mode="heightFix" />
				<image src="https://i.loli.net/2021/04/13/o8hRrCk51gOw2pl.png" mode="heightFix" />
				<image src="https://i.loli.net/2021/04/13/vtfkYb7XCaKSwg1.png" mode="heightFix" />
			</view>
			<view class="choose">
				<text class="chooseItem">洗车</text>
				<text class="chooseItem">美容</text>
				<text class="chooseItem">轮胎</text>
			</view>
			<view class="washCar">
				<view class="item" v-for="item in wash" :key="item.id">
					<view class="radioBox">
						<radio value="" :checked="item.checked" @click="checkWash(item)" />
						<view class="saleCount">
							<text style="font-size: 30rpx; font-weight: bold;">{{item.title}}</text>
							<text style="font-size: 24rpx; color: #999999;">评价 4.8 已售 369</text>
						</view>
					</view>
					<view class="price-icon">
						<view class="price">
							<text style="font-size: 30rpx; font-weight: bold; color: #ff5300;">￥{{item.price}}</text>
							<text style="font-size: 24rpx; color: #999999;">门店价 ￥{{item.price}}</text>
						</view>
						<image src="../../static/image/xicheiantou@3x.png" mode="widthFix" style="width: 10rpx;" />
					</view>
				</view>

			</view>
		</view>
		<view class="instructions">
			<text class="title">使用说明</text>
			<view class="icon">
				<view class="item">
					<image src="https://i.loli.net/2021/04/13/XJeu95WPl1xzTmD.png" mode="widthFix" />
					<text>在线下单</text>
				</view>
				<view class="item">
					<image src="https://i.loli.net/2021/04/13/XjUOEeiIw9ugm2q.png" mode="widthFix" />
					<text>到店使用</text>
				</view>
				<view class="item">
					<image src="https://i.loli.net/2021/04/13/zmSZHo3if7naNw9.png" mode="widthFix"></image>
					<text>扫码服务</text>
				</view>
			</view>
			<view class="tips">
				<image src="../../static/image/dengpao@3x.png" mode="widthFix" style="width: 40rpx;"></image>
				<text>温馨提示:到店出示订单中的二维码，代金券及订单号等不能作为消费凭证。</text>
			</view>
		</view>
		<view class="assess">
			<text class="title">门店评价(888)</text>
			<view class="item">
				<view class="picture">
					<image src="https://i.loli.net/2021/04/13/P3whBQf9jyA8TEk.png" mode="widthFix"></image>
				</view>
				<view class="information">
					<view class="phone">183134**431</view>
					<view class="star">
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
					</view>
					<view class="say">认真负责，满足客户需求，工作人员也很热情，会一直来减肥减肥龙卷风累计欸据二零</view>
					<view class="choose">标准洗车·五座轿车</view>
				</view>
			</view>
			<view class="item">
				<view class="picture">
					<image src="https://i.loli.net/2021/04/13/P3whBQf9jyA8TEk.png" mode="widthFix"></image>
				</view>
				<view class="information">
					<view class="phone">183134**431</view>
					<view class="star">
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
						<image src="../../static/image/xing@3x.png" mode="widthFix"></image>
					</view>
					<view class="say">认真负责，满足客户需求，工作人员也很热情，会一直来减肥减肥龙卷风累计欸据二零</view>
					<view class="choose">标准洗车·五座轿车</view>
				</view>
			</view>
			<view class="allAssess">
				查看全部评价(369)
			</view>
		</view>
		<view class="nearStore">
			<text class="title">附近门店</text>
			<view class="item">
				<HomeStore />
				<view class="buyService">
					<view class="titleName">
						<view>标准洗车</view>
					</view>
					<view class="price">
						<text style="font: 24rpx; text-decoration: line-through; color: #cdcdcd;">￥35</text>
						<text>￥30.00</text>
						<button type="default">购买</button>
					</view>
				</view>
				<view class="buyService">
					<view class="titleName">
						<view>标准洗车</view>
					</view>
					<view class="price">
						<text style="font: 24rpx; text-decoration: line-through; color: #cdcdcd;">￥35</text>
						<text>￥30.00</text>
						<button type="default">购买</button>
					</view>
				</view>
				<view class="buyService">
					<view class="titleName">
						<view>标准洗车</view>
					</view>
					<view class="price">
						<text style="font: 24rpx; text-decoration: line-through; color: #cdcdcd;">￥35</text>
						<text>￥30.00</text>
						<button type="default">购买</button>
					</view>
				</view>
			</view>
			<view class="item">
				<HomeStore />
			</view>
			<view class="item">
				<HomeStore />
			</view>
		</view>
		<view class="loading">
			正在加载
		</view>
		<view class="balance">
			<view class="price">￥25</view>
			<navigator url="/pages/home/groupBuying" class="button">结算</navigator>
		</view>
	</view>
</template>

<script>
	import HomeStore from "../../components/homeStore/HomeStore.vue"
	//打开第三方地图
	import Map from "../../js_sdk/ms-openMap/openMap.js"
	//vuex
	import {
		createNamespacedHelpers
	} from "vuex";
	let {
		mapState,
		mapActions,
		mapMutations
	} = createNamespacedHelpers(
		"home"
	);

	export default {
		components: {
			HomeStore
		},
		onLoad: function(option) {
			this.getStoreDetail({
				shopId: option.shopId
			})
		},
		data() {
			return {
				//洗车类型
				wash: [{
						id: 1,
						title: '标准洗车-5座轿车',
						price: 25.00,
						checked: false
					},
					{
						id: 2,
						title: '标准洗车-越野、商务',
						price: 40.00,
						checked: false
					},
					{
						id: 3,
						title: '全套精洗',
						price: 60.00,
						checked: false
					}
				]
			};
		},
		computed: {
			...mapState(["store"])
		},
		methods: {
			...mapActions(["getStoreDetail"]),

			//openMap
			openMap(latitude, longitude, name, coord_type) {
				Map.openMap(latitude, longitude, name, coord_type)
			},

			//切换单选框
			checkWash(item) {
				this.wash.forEach(item => item.checked = false)
				item.checked = !item.checked
			},

		}
	}
</script>

<style lang="scss" scoped>
	.store {
		background-color: #f9f9f9;
		position: relative;

		.header {
			height: 488rpx;
			background: url('https://sc02.alicdn.com/kf/U77806340201c486aa4c16a9753f8a535z.jpg');
			background-size: 100vw;

			.return {
				padding: 60rpx 24rpx;
			}
		}

		.timer-address {
			width: 90vw;
			background-color: #FFFFFF;
			border-radius: 24rpx;
			margin: 24rpx;
			padding: 24rpx;
			position: absolute;
			top: 400rpx;


			.title {
				font-size: 32rpx;
				color: #333333;
				font-weight: bold;
			}

			.image {
				margin: 24rpx 0;

				image {
					width: 30rpx;
					margin: 0 8rpx 0 0;
				}

				.score {
					color: #f26200;
					font-size: 24rpx;
				}

				.order {
					font-size: 24rpx;
					color: #999999;
					margin: 0 20rpx 0 30rpx;
				}

				.number {
					font-size: 24rpx;
					color: #999999;
				}
			}

			.working {
				font-size: 20rpx;
				color: #999999;
				display: flex;
				align-items: center;

				image {
					width: 30rpx;
					margin-right: 10rpx;
				}
			}

			.address {
				padding: 48rpx 24rpx;
				border-radius: 20rpx;
				background-color: #f9f9f9;
				display: flex;
				justify-content: space-between;

				.text {
					display: flex;
					flex-direction: column;
					justify-content: space-between;

					.text1 {
						font-size: 24rpx;
						color: #333333;
						margin-bottom: 20rpx;
					}

					.text2 {
						font-size: 22rpx;
						color: #999999;
					}
				}

				.navButton {

					image {
						width: 60rpx;
						margin: 0 16rpx 0 60rpx;
					}
				}
			}
		}

		.line {
			margin-top: 360rpx;
			text-align: center;
		}

		.storeService {
			padding: 24rpx;
			margin: 24rpx;
			background-color: #FFFFFF;
			border-radius: 20rpx;

			.storeName {
				font-size: 36rpx;
				color: #666666;
				font-weight: bold;
			}

			.picture {
				display: flex;
				margin: 20rpx 0;

				image {
					height: 40rpx;
					margin-right: 24rpx;
				}
			}

			.choose {
				padding: 60rpx 0;

				.chooseItem {
					font-size: 28rpx;
					color: #999999;
					margin-right: 40rpx;

					&.active {
						font-size: 32rpx;
						color: #ff5300;
					}
				}
			}

			.washCar {
				.item {
					display: flex;
					justify-content: space-between;

					.radioBox {
						display: flex;

						.radio {
							margin-right: 26rpx;

							radio {
								// width: 10rpx;
								scale: 0.6
							}
						}

						.saleCount {
							display: flex;
							flex-direction: column;
						}
					}


					.price-icon {
						display: flex;
						justify-content: space-between;

						.price {
							display: flex;
							flex-direction: column;
						}
					}
				}
			}
		}

		.instructions {
			padding: 24rpx;
			background-color: #FFFFFF;
			margin: 24rpx;
			border-radius: 20rpx;

			.title {
				font-size: 36rpx;
				font-weight: bold;
				color: #666666;
			}

			.icon {
				margin: 40rpx 0;
				display: flex;
				justify-content: space-between;

				.item {
					display: flex;
					flex-direction: column;
					align-items: center;
					font-size: 30rpx;

					image {
						width: 80rpx;
					}

				}
			}

			.tips {
				padding: 18rpx;
				display: flex;
				justify-content: space-between;
				font-size: 24rpx;
				align-items: center;
				border-radius: 16rpx;
				background-color: #d9f1ff;
				color: #0087d6;
			}
		}

		.assess {
			background-color: #FFFFFF;
			border-radius: 20rpx;
			padding: 24rpx;
			margin: 24rpx;

			.title {
				font-size: 36rpx;
				font-weight: bold;
				color: #666666;
			}

			.item {
				display: flex;
				margin: 30rpx 0;

				.picture {
					image {
						width: 80rpx;
					}
				}

				.information {
					.phone {
						font-size: 28rpx;
						font-weight: bold;
					}

					.star {
						image {
							width: 20rpx;
						}
					}

					.say {
						font-size: 24rpx;
					}

					.choose {
						font-size: 20rpx;
						color: #cccccc;
					}
				}
			}

			.allAssess {
				border-top: 1px solid #F8F8F8;
				font-size: 22rpx;
				color: #999999;
				text-align: center;
				padding: 20rpx 0;
			}
		}

		.nearStore {
			padding: 24rpx;
			margin: 24rpx;
			background-color: #FFFFFF;
			border-radius: 20rpx;

			.title {
				font-size: 36rpx;
				font-weight: bold;
				color: #666666;
			}

			.item {
				.buyService {
					display: flex;
					justify-content: space-between;
					padding: 24rpx;

					.titleName {
						font-size: 30rpx;
					}

					.price {
						display: flex;
						font-size: 24rpx;

						button {
							width: 100rpx;
							height: 40rpx;
							font-size: 24rpx;
							background-color: #fe8d13;
							margin: 0 0 0 10rpx;
							padding: 0;
							color: white;
							line-height: 40rpx;
						}
					}
				}
			}

		}

		.loading {
			height: 400rpx;
		}

		.balance {
			padding: 24rpx 0 0 24rpx;

			background-color: #FFFFFF;
			border-radius: 20rpx 20rpx 0 0;
			position: fixed;
			bottom: 0;
			width: 100%;
			height: 124rpx;
			box-sizing: border-box;

			display: flex;
			justify-content: space-between;

			.price {
				font-size: 48rpx;
				color: #ff5300;
				font-weight: bold;
				line-height: 100rpx;
			}

			.button {
				background-color: #ff7010;
				color: white;
				width: 236rpx;
				height: 100rpx;
				font-size: 32rpx;
				line-height: 100rpx;
				border-radius: 0 20rpx 0 0;
				text-align: center;
			}

		}
	}
</style>
